package pl.edu.agh.neuraleconomy.common.utils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;


public class FileUtils {

	public static void saveToFile(InputStream is, File file){
		FileOutputStream fos = null;
		try{
			fos = new FileOutputStream(file);
			IOUtils.copy(is, fos);
		}catch(Exception e){
			
		}finally{
			IOUtils.closeQuietly(fos);
		}
	}
	
	public static void deleteQuietly(File file){
		try{
			file.delete();
		}catch(Exception e){
			
		}
	}
}
